# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-readme_renderer
pkgver=42.0
pkgrel=1
pkgdesc="readme_renderer is a library for rendering README descriptions for Warehouse"
url="https://github.com/pypa/readme_renderer"
# loongarch64: tests fail
arch="noarch !loongarch64"
license="Apache-2.0"
depends="
	py3-bleach
	py3-docutils
	py3-nh3
	py3-pygments
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-mock
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/r/readme_renderer/readme_renderer-$pkgver.tar.gz"
builddir="$srcdir/readme_renderer-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
76d78fb2d92faa581679691feeb3cec50ef518417c6c1f187527209ac995f549b4de4b38c7449d1e4dfa7b93d30bfd599db7d01e5e5228c00a24261b0421ce66  readme_renderer-42.0.tar.gz
"
